package com.pureut.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.pureut.order.domain.ProcurementPlan;
import com.pureut.order.dto.ProcurementPlanDto;
import com.pureut.order.vo.OrderReviewVo;
import com.pureut.order.vo.PlanReleaseVo;
import com.pureut.order.vo.ProcurementPlanUpdateVo;
import com.pureut.order.vo.ProcurementPlanVo;
import com.sale.common.mybatis.core.page.PageQuery;
import com.sale.common.mybatis.core.page.TableDataInfo;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * 采购计划service
 */
public interface ProcurementPlanService {

    /**
     * 采购计划列表
     */
    TableDataInfo<Map<String,Object>> getList(ProcurementPlanVo procurementPlanVo, PageQuery pageQuery);

    /**
     * 新增采购计划列表
     */
    boolean addProcurementPlan(Map<String,Object> map) throws Exception;

    /**
     * 修改采购计划
     */
    boolean updateProcurementPlan(Map<String,Object> map) throws JsonProcessingException;

    /**
     * 提交审核
     */
    boolean submitReview(Long id);

    /**
     * 撤销审核
     */
    boolean deleteReview(Long id);

    /**
     * 删除采购计划
     */
    boolean deleteProcurementPlan(String ids);

    /**
     * 撤回采购计划
     */
    boolean backPlan(Long id) throws SQLException;

    /**
     * 关结采购计划
     */
    boolean closePlan(ProcurementPlanVo procurementPlanVo);

    /**
     * 查看
     */
    Map<String,Object> getPlanById(Long id);

    /**
     * 审核单据
     */
    boolean purchaseReview(OrderReviewVo orderReviewVo) throws Exception;

    /**
     * 计划下达数据回显
     */
    List<ProcurementPlanDto> planReleaseView(String ids);

    /**
     * 计划下达
     */
    boolean planRelease(PlanReleaseVo planReleaseVo) throws Exception;
}
